package com.jay.lang.ref.clazz;

//强引用所指向的对象在任何时候都不会被系统回收
//私有类FinalReference为强引用
public class ReferenceCls {
	// -Xmx2m -Xms2m
	public static void main(String[] args) {
		// Strong reference
		Bean bean = new Bean("name", 10);
		System.gc();
		System.runFinalization();
		System.out.println(bean);

		Bean[] referent = new Bean[100000];
		for (int i = 0; i < referent.length; i++) {
			referent[i] = new Bean("mybean:" + i, 100);// 抛 Exception
		}

	}
}
